package com.iias.communication.domain;

import com.iias.communication.util.SocketInfoUtils;
import io.netty.channel.Channel;


public class ClientInfo {

    private String ip;

    private Integer port;

    private Channel channel;

    public ClientInfo(Channel channel) {
        this.channel = channel;
        String host = SocketInfoUtils.getHost(channel);
        String[] split = host.split(":");
        ip = split[0].replace("/","");
        port = Integer.valueOf(split[1]);
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Integer getPort() {
        return port;
    }

    public void setPort(Integer port) {
        this.port = port;
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }
}
